using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Dici : MonoBehaviour
{
    public float interval;
    public GameObject bulletPrefab1, bulletPrefab2;
    private float timer;
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        if (timer > 0)
        {
            timer -= Time.deltaTime;
        }
        else
        {
            GameObject bullet1 = ObjectPool.Instance.GetObject(bulletPrefab1);
            GameObject bullet2 = ObjectPool.Instance.GetObject(bulletPrefab2);
            bullet1.transform.position = transform.position;
            bullet2.transform.position = transform.position;
            timer = interval;
        }
    }
}
